/**
 * 通过的登录的管理员用户名查询数据库回填到ShowAdmin页面中
 */

 //ajAX查询管理员信息
    function createXMLHttpRequest(){
    	if (window.XMLHttpRequest){
    		XMLHttpReq = new XMLHttpRequest();
    	}
    	else if (window.ActiveXObject){
    		try{
    			XMLHttpReq = new ActionXObject("Msxm12.XMLHTTP");
    		} catch (e) {
    			try{
    				XMLHttpReq = new ActionXObject("Microsoft.XMLHTTP");
    			} catch (e) {
    				
    			}
    		}
    	}
    }
    
    function sendRequest(url){
    	createXMLHttpRequest();
    	XMLHttpReq.open("GET",url,true);
    	XMLHttpReq.onreadystatechange = processResponse;
    	XMLHttpReq.send(null);
    }
    
    function processResponse(){
    	if (XMLHttpReq.readyState == 4) {
    		//window.alert(XMLHttpReq.status);
    		if (XMLHttpReq.status == 200 || XMLHttpReq.status == 0){
    			res = XMLHttpReq.responseXML.getElementsByTagName("res")[0].firstChild.data;
    			//window.alert(res);
//    			if(res=="true"){
//    				window.alert(res);
//    			}
    			
//    			if (res == false) {
//    				document.getElementById("userNameERR").innerHTML = "<font color='red' font size='2px'>\用户名已存在，请重新输入！</font>";
//    			}
    		}else {
    			window.alert(XMLHttpReq.status+"您所请求的页面有异常！！！！");
    		}
    	}
    }
    
    function signUp(account){
    	//var account = document.getElementById("account").value;
    	sendRequest('signUp?account='+ account);
    	return res;
    }
    
    //回车进入下一个文本框
    function EnterPress(e){ //传入 event
    	var e = e || window.event;
    	if(e.keyCode == 13){
    		event.keyCode=9;
    	}
    	} 